package com.bigfans.base.exception;

import com.bigfans.framework.web.RestResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Huang Hong Fei
 * @createAt 2020/12/11
 * @description
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = Throwable.class)
    public RestResponse handle(Throwable e){
        return RestResponse.error(e.getMessage());
    }
}
